#include <bits/stdc++.h>
using namespace std;


double points[16][2], dp[1 << 17][17];
int n;
double dis(int x, int y){
    return sqrt((points[x][0] - points[y][0]) * (points[x][0] - points[y][0]) + (points[x][1] - points[y][1]) * (points[x][1] - points[y][1]));
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> points[i][0] >> points[i][1];

    for (int i = 0; i <= (1 << n); i++)
        for (int j = 0; j <= n; j++)
            dp[i][j] = 1e9;

    for (int i = 1; i < (1 << n); i++){
        for (int j = 1; j <= n; j++){
            if (i & (1 << (j - 1)) == 0)
                continue;
            if (i == (1 << (j - 1))){
                dp[i][j] = 0;
                continue;
            }
            for (int k = 1; k <= n; k++)
                if ((i & (1 << (k - 1))) && k != j)
                    dp[i][j] = min(dp[i][j], dp[i ^ (1 << (j - 1))][k] + dis(j, k));

        }
    }

    double ans = 1e9;
    for (int i = 1; i <= n; i++)
    { // 从1开始，因为0是起点
        ans = min(ans, dp[(1 << n) - 1][i] + dis(i, 0));
    }

    cout << fixed << setprecision(2) << ans << endl;
    return 0;
}